home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7555 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.0 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: memory allocation using malloc and free
  5. Date: 25 Feb 1996 13:11:30 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4gqja2INN8vr@keats.ugrad.cs.ubc.ca>
  8. References: <4gagll$5rc@bertrand.ccs.carleton.ca> <4gbqd7$1em@inet-nntp-gw-1.us.oracle.com> <4gd8ngINNp5i@keats.ugrad.cs.ubc.ca> <danpop.824952492@rscernix>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <danpop.824952492@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
  12. >In <4gd8ngINNp5i@keats.ugrad.cs.ubc.ca> c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
  13. >
  14. >>But can a compiler which restricts size_t to 16-bits a be a strictly conforming
  15. >>implementation? (I don't have the standard documents yet, so I'm forced to
  16. >>ask). 
  17. >
  18. >Yes.
  19.  
  20. How did that get out? I cancelled that article within literally minutes of
  21. having sent it.
  22.  
  23. Say, wasn't NNTP designed by a bunch of zoologists?  ;)
  24.  
  25. >>If 16-bit size_t is admitted within the limitations of the standard, it
  26. >>means that a strictly conforming program has to robustly accomodate itself on
  27. >>such crippled architectures. I know that ANSI has some bottom limits on what
  28. >>can be considered a viable architecture to host the C language, but what are
  29. >>those limits?
  30. >
  31. >For this particular discussion, the limit is 32K - 1.  And no more than
  32. >one object of this size.  (Actually the phrasing is a little bit silly,
  33. >because it doesn't even guarantee that every program containing such an
  34. >object can be compiled and run, it requires that at least one program 
  35. >should be correctly translated):
  36. >
  37. >    2.2.4.1 Translation limits
  38. >
  39. >    The implementation shall be able to translate and execute at least
  40. >    one program that contains at least one instance of every one of the
  41. >    following limits:
  42. >...
  43. >     * 32767 bytes in an object (in a hosted environment only) 
  44.  
  45. That is strange wording. I wonder what the "at least one program" refers to.
  46. At least one arbitrary string of input symbols that represents a valid C
  47. program sentence, such that the slightest change results in a different program
  48. that doesn't have to be translated?  Or translate any such program and then
  49. erase itself out at its own discretion? :) Or execute one such program in the
  50. sense of multi-programming, where two or more can be loaded at the same time?
  51. Hmm.
  52.  
  53. The answer to my cancelled article is enlightening, however. I cancelled
  54. because I did find a somewhat satisfactory answer in the K&R, which does 
  55. clearly state that the minimum maximum for an integer is 32768. Limits are not
  56. given for size_t, but I inferred that this would also be an acceptable minimum
  57. maximum for that type.
  58.  
  59. By the way, it would have been good to show the other "following limits". To
  60. what extent can you directly reproduce portions of the standard in the
  61. newsgroup?  What is a reasonable quote and what is not? I mean, if I were to
  62. keep quoting K&R in responses to questions, _eventually_ someone will be able
  63. to collect the entire work, which would mark me as a plagiarist. :) 
  64. -- 
  65.  
  66.